<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let num = 123
        let str = '123'
        let bool = true
        let und = undefined
        let nul = null
        let symb = Symbol('id')
        let big = 9007199254740999n

        let arr = [1, 2, 3]
        let obj = {}
        let fn = function () { }
        let date = new Date()   // [object Date]
        let reg = /a/g          // [object RegExp]
        let error = new Error() // [object Error]

        // 封装一个CheckType  ? 打印数组里面元素的数据类型
        const tempArr = [num, str, bool, und, nul, symb, big, arr, obj, fn, date, reg, error]

        const CheckType = (arr) => {
            arr.forEach(el => {
                console.log(Object.prototype.toString.call(el))
            })
        }
        CheckType(tempArr)
    </script>
</body>

</html>